﻿using System.Collections.Generic;
using System.Text;

namespace Ex03.GarageLogic
{
    public static class Factory
    {
        public enum eVehicleTypesSupported
        {
            FuelCar,
            ElectricCar,
            FuelMotorcycle,
            ElectricMotorcycle,
            FuelTruck
        }

        public static Vehicle MakeVehicle(eVehicleTypesSupported i_VehicleType)
        {
            Vehicle retVehicle;

            switch (i_VehicleType)
            {
                case eVehicleTypesSupported.FuelCar:
                    retVehicle = new FuelCar();
                    break;
                case eVehicleTypesSupported.ElectricCar:
                    retVehicle = new ElectricCar();
                    break;
                case eVehicleTypesSupported.FuelMotorcycle:
                    retVehicle = new FuelMotorcycle();
                    break;
                case eVehicleTypesSupported.ElectricMotorcycle:
                    retVehicle = new ElectricMotorcycle();
                    break;
                case eVehicleTypesSupported.FuelTruck:
                    retVehicle = new FuelTruck();
                    break;
                default:
                    throw new System.Exception("Type of vehicle not supported.");
            }

            return retVehicle;
        }
    }
}